<div class="title">  
  <div class="left">
    企业员工分组
  </div>  
  <div class="right">
    <%= link_to '增加', new_group_user_url(current_user), :method => :get, :remote => true, :class => 'crud new' if current_user.is_admin? %>
  </div>
</div>
<% current_user.enterprise.groups.each do |group|  %>
<div id="group<%=group.id%>" class='grid_15 alpha omega group <%= cycle '','h' %>'>
  <div class='grid_2 alpha'>
    <%= image_tag "users/users.png", :size => '50x50', :class => "logo" %>
  </div>
  <div class='grid_5 detail'>
    <div class='name'>
      <%= group.name %>
    </div>
    <div class='remark'>
      <%= group.remark %>
    </div>
  </div>
  <div class='grid_6 detail'>
    <%if group.users.present?%>
      <div class='group_title'>
         组内人员
      </div>
      <%group.users.each do |user|%>
        <div class='user_name'>
          <%=user.full_name%>
        </div>
      <%end%>
    <%end%>
  </div>
  <% if current_user.is_admin?%>
    <div class='grid_2 omega tools'>
    <%= link_to "编辑分组", edit_group_user_url(group),
         :remote => true,
         :method => :get,
         :title => '编辑企业员工分组',
         :class => 'tool' %>
      <%= link_to "删除分组", destroy_group_user_url(group),
           :remote => true,
           :method => :delete,
           :title => '删除企业员工分组',
           :class => 'tool',
           :confirm => "确定要删除该分组吗？"%>
  </div>
  <% end %>
</div>
<% end %>